import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'
import { PoorEditor, PoorEditorHandler } from 'poor-editor'
import { useRef } from 'react'

function App() {
  const ref = useRef<PoorEditorHandler>(null)
  
  const onClick = () => {
    const html = ref.current?.getHTML()
    alert(html)
  }

  return (
    <>
      <div style={{
        textAlign: 'left'
      }}>
        <PoorEditor ref={ref}
          showHTML={false}
          showJSON={false}
          initContent={'hello world'}
        />
        <button onClick={onClick}>HTML</button>
      </div>
      <div>
        <a href="https://vitejs.dev" target="_blank">
          <img src={viteLogo} className="logo" alt="Vite logo" />
        </a>
        <a href="https://react.dev" target="_blank">
          <img src={reactLogo} className="logo react" alt="React logo" />
        </a>
      </div>
    </>
  )
}

export default App
